package com.foreveross.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * TenementHouse entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tenement_house", catalog = "hrtenement")
public class TenementHouse implements java.io.Serializable {

	// Fields

	private String id;
	private Tenement tenement;
	private HrHouses hrHouses;

	// Constructors

	/** default constructor */
	public TenementHouse() {
	}

	/** minimal constructor */
	public TenementHouse(String id) {
		this.id = id;
	}

	/** full constructor */
	public TenementHouse(String id, Tenement tenement, HrHouses hrHouses) {
		this.id = id;
		this.tenement = tenement;
		this.hrHouses = hrHouses;
	}

	// Property accessors
	@Id
	@GenericGenerator(name="idGenerator", strategy="uuid")
	@GeneratedValue(generator="idGenerator") 
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tenement_id")
	@NotFound(action=NotFoundAction.IGNORE)
	public Tenement getTenement() {
		return this.tenement;
	}

	public void setTenement(Tenement tenement) {
		this.tenement = tenement;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "house_id")
	@NotFound(action=NotFoundAction.IGNORE)
	public HrHouses getHrHouses() {
		return this.hrHouses;
	}

	public void setHrHouses(HrHouses hrHouses) {
		this.hrHouses = hrHouses;
	}

}